import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import request from './request';
import moment from 'moment';
import echarts from 'echarts';

Vue.config.productionTip = false
Vue.use(ElementUI);
Vue.use(request);
// 时间过滤器
Vue.filter('newFromTime', function (oldFromTime) {
  //获取日期时间戳
  const origin = new Date(oldFromTime);
  //获取年月日
  const y = origin.getFullYear();
  // 月份和日子补零  月份加一 
  const m = (origin.getMonth() + 1 + '').padStart(2, '0');
  const d = (origin.getDate() + '').padStart(2, '0');
  //获取时分秒
  const hh = (origin.getHours() + '').padStart(2, '0');
  const mm = (origin.getMinutes() + '').padStart(2, '0');
  const ss = (origin.getSeconds() + '').padStart(2, '0');

  //返回格式化时间
  return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
})
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
